<?php include 'includes/pagetop.php';?>
	
<?php include 'includes/navigation.php';?>

<?php include 'includes/tabletopcontainer.php';?>



<?php if ($action == ''): ?>

	   <div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">

				<tr>
					<th class="table-header-repeat line-left">id</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Created On</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Updated On</a></th>
					<th class="table-header-repeat line-left"><a href="">Updated By</a></th>
					<th class="table-header-repeat line-left"><a href="">Name</a></th>
					<th class="table-header-repeat line-left"><a href="">Title</a></th>
					<th class="table-header-options line-left"><a href="">Action</a></th>
				</tr>
					<?php if (isset($pageList)): ?>
						{pageList}
						<tr class="alternate-row">
							<td><input  type="checkbox"/></td>
							<td>{created_on}</td>
							<td>{updated_on}</td>
							<td>{updated_by}</td>
							<td>{name}</td>
							<td>{title}</td>
							<td class="options-width">
							<a href="{url}/{page}/edit/{id}" title="Edit" class="icon-1 info-tooltip"></a>
							<a href="{url}/{page}/delete/{id}" title="Delete" class="icon-2 info-tooltip"></a>
							</td>
						</tr>
						{/pageList}
					<?php endif; ?>

				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			<!--  end content-table  -->
		
			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
			
			<!--  start paging..................................................... -->
			<table border="0" cellpadding="0" cellspacing="0" id="paging-table">
			<tr>
			<td>
				<a href="" class="page-far-left"></a>
				<a href="" class="page-left"></a>
				<div id="page-info">Page <strong>1</strong> / 15</div>
				<a href="" class="page-right"></a>
				<a href="" class="page-far-right"></a>
			</td>
			<td>
			<select  class="styledselect_pages">
				<option value="">Number of rows</option>
				<option value="">1</option>
				<option value="">2</option>
				<option value="">3</option>
			</select>
			</td>
			</tr>
			</table>
			<!--  end paging................ -->
			
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
	      
	
<?php elseif($action == 'add' || $action == 'edit' ): ?>   

	    <form method="post" action="{url}/{page}/<?php echo $action == 'edit' ? 'update' : 'add'; ?>/">
		<input type="hidden" name="id" value="{id}" />
	
           	 
		<!--  start step-holder -->
		<div id="step-holder">
			<div class="step-no">1</div>
			<div class="step-dark-left">Create New {caption}</div>
			<div class="step-dark-round">&nbsp;</div>
			<div class="clear"></div>
		</div>

		<!--  end step-holder -->
	
		<!-- start id-form -->
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">

		<tr>
			<th valign="top">Page Name:</th>
			<td><input type="text" class="inp-form"  name="name" value="<?=(isset($pageData->name)?$pageData->name:'');?>"/></td>
			<td></td>
		</tr>
		<tr>
			<th valign="top">Title:</th>
			<td><input type="text" class="inp-form"  name="title"  value="<?=(isset($pageData->title)?$pageData->title:'');?>"/></td>
			<td></td>
		</tr>

		
	<tr>
			<th valign="top">Content</th>
			<td valign="top" colspan="2">
			<textarea name="content" id="ckeditorTextarea" ><?=(isset($pageData->content)?$pageData->content:'');?></textarea>
			<?php echo display_ckeditor($ckeditor); ?>
			</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td valign="top">
			<input type="submit" value="" class="form-submit" />
			<input type="reset" value="" class="form-reset"  />
		</td>
		<td></td>
	</tr>

	</table>

	<div class="clear">
	</div>
					
	<!-- end id-form  -->
	  
<?php endif; ?> 

<?php include 'includes/tablebottomcontainer.php';?>